<?php

function strToclassName($s){
    $s = ucfirst($s) ;
    return preg_replace_callback("/([-_]\w)/" ,function($m){
        return strtoupper($m[1][1]);
    }, $s) ;
}

function tag($key , $value = null){
    if(App::$debug == -1){
        return ;
    }
    echo  "----------------------------> {$key} <----------------------------\n";
    if($value != null){
        print_r($value) ;
    }
    echo "\n\n";
}

function strToDirname($s){
    $s = explode('\\' , $s) ;
    $ss = array_pop($s);
    $ss = str_replace('Controller' , '' , $ss) ;
    $ss = lcfirst($ss) ;
    return preg_replace_callback("/([A-Z])/" ,function($m){
        return '-'.strtolower($m[1]);
    }, $ss) ;
}